package com.cdream.basic.classiccase.miaosha.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.cdream.basic.classiccase.miaosha.entity.Item;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author zs
 * @since 2021-07-17
 */
public interface ItemService extends IService<Item> {


    int increaseSales(Integer itemId, Integer amount);

    boolean decreaseStock(Integer itemId, Integer amount);

    Item getByIdFromCache(Integer itemId);

    boolean decreaseStockByRedis(Integer itemId, Integer amount);

    boolean decreaseStockForMq(Integer itemId, Integer amount);

    void publishPromo(Integer itemId);

    boolean increaseStock(Integer itemId, Integer amount);

    void testMysql();

}
